<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateWechatTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('wechat', function(Blueprint $table)
		{
			$table->increments('id');
			$table->char('object_id', 36)->comment('objectId');
			$table->string('type')->comment('公共号类型:subscribe订阅号;service服务号');
			$table->string('name', 64)->comment('公众号名称');
			$table->char('account', 30)->comment('原始ID');
			$table->char('app_id', 30)->index('app_id_index')->comment('appID');
			$table->char('app_secret', 32)->comment('appSecret');
			$table->string('url', 128)->nullable()->comment('url');
			$table->string('token', 128)->nullable()->comment('Token');
			$table->string('mch_id', 128)->nullable()->comment('商家id');
			$table->string('pay_key', 128)->nullable()->comment('支付key');
			$table->string('notify_url', 128)->nullable()->comment('支付回调通知地址');
			$table->string('qrcode', 128)->nullable()->comment('二维码Code');
			$table->string('primary')->default('0')->comment('默认公众号:0未认证;1已认证');
			$table->string('certified')->default('0')->comment('认证类型:0未认证;1已认证');
			$table->string('status')->default('0')->comment('状态');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('wechat');
	}

}
